


/**
 * 配置日期
 * @returns
 */
export function custom_shortcuts() {


    const now = new Date();
    const firstDay = new Date(now.getFullYear(), now.getMonth(), 1);
    const lastDay = new Date(now.getFullYear(), now.getMonth() + 1, 0);

    const shortcuts = [
        {
            text: '本月',
            value: () => {
                const end = lastDay
                const start = firstDay
                return [start, end]
            },
        },
        {
            text: '最近7天',
            value: () => {
                const end = new Date()
                const start = new Date()
                start.setDate(start.getDate() - 7)
                return [start, end]
            },
        },
        {
            text: '最近一个月',
            value: () => {
                const end = new Date()
                const start = new Date()
                start.setMonth(start.getMonth() - 1)
                return [start, end]
            },
        },
        {
            text: '最近三个月',
            value: () => {
                const end = new Date()
                const start = new Date()
                start.setMonth(start.getMonth() - 3)
                return [start, end]
            },
        },
    ]

    return shortcuts

}
